<?php

namespace app\admin\model;

use think\Model;

class BusinessCircle extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'ty_business_circle';

    //指定主见
    protected $pk = 'bc_id';

    //只读字段
    //protected $readonly = ['name','email'];

    //自动写入时间戳
    //protected $autoWriteTimestamp = true;

    //自动写入日期
    //protected $autoWriteTimestamp = 'datetime';

    // 设置返回数据集的对象名
    protected $resultSetType = 'collection';

    public static function zselect()
    {
        return self::select();
    }

    /**
     * 商圈到小区
     */
    public function circleToQuarters()
    {
        return $this->hasMany('ResidentialQuarters','rq_bc_id','bc_id');
    }
}
